import Vue from 'vue'
import Router from 'vue-router'
import Index from './views'
const Experiment = () => import(/* webpackChunkName: "experiment" */ './views/experiment')
const ExperimentList = () => import(/* webpackChunkName: "experiment" */ './views/experiment/home')
const NewExperiment = () => import(/* webpackChunkName: "experiment" */ './views/experiment/new')
const EditCanves = () => import(/* webpackChunkName: "experiment" */ './views/experiment/canves')
const ExpHistory = () => import(/* webpackChunkName: "experiment" */ './views/experiment/history')
const DataList = () => import(/* webpackChunkName: "data" */ './views/data/home')
const ModelList = () => import(/* webpackChunkName: "model" */ './views/model/home')

Vue.use(Router)

export default new Router({
    mode: 'hash',
    base: process.env.BASE_URL,
    routes: [
        {
            path: '/',
            name: 'index',
            redirect: '/experiment',
            component: Index,
            children: [
                {
                    path: 'experiment',
                    component: Experiment,
                    name: '实验管理',
                    redirect: '/experiment/list',
                    children: [
                        { name: '', path: 'list', component: ExperimentList },
                        { name: '新建实验', path: 'new', component: NewExperiment },
                        { name: '实验编辑器', path: 'editExp', component: EditCanves },
                        { name: '实验运行历史', path: 'history', component: ExpHistory }
                    ]
                },
                { path: 'data', name: '数据管理', component: DataList },
                { path: 'model', name: '模型管理', component: ModelList }
            ]
        }
    ]
})
